def file_read():
  line_num = 0
  f = open("C:\Users\cong\Desktop\mac_new.txt", 'w')
  with open("C:\Users\cong\Desktop\mac.txt") as file:
    for line in file:
      str = line.rstrip()
      if str == '':
        continue
      idx = 0;
      new_str = ''
      for x in str:
        idx = idx+1
        new_str = new_str + x
        if idx % 2 == 0 and idx < 12:
          new_str = new_str + ":"
      f.write(new_str)
      f.write('\r');
      #line_num += 1
      #print('{:>4} {}'.format(line_num, line.rstrip()))

def file_write():
	with open("e:/t1.txt", mode="a", encoding="utf-8") as file:
		file.write("append test")
	  
if __name__ == '__main__':
	# file_write()
	file_read()
